﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace eShop.Model
{
    public class CartItem
    {
        public CartItem(Product product, ProductStock stock, int quantity, double unitPrice)
        {
            Product = product;
            Stock = stock;
            Quantity = quantity;
            UnitPrice = unitPrice;
        }

        public Product Product { get; set; }
        public ProductStock Stock { get; set; }
        public int Quantity { get; set; }
        public double UnitPrice { get; set; }
        public double TotalWeight { get { return Quantity * Stock.Weight; } }
        public double TotalPrice { get { return Quantity * UnitPrice; } }
    }
}
